package ee.serge.service;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import ee.serge.shared.Admin;
import ee.serge.shared.Feedback;
import ee.serge.shared.HandledException;
import ee.serge.shared.IPFeedbackData;
import ee.serge.shared.Loan;

@RemoteServiceRelativePath("controlPanel")
public interface ControlPanelService extends RemoteService {

   void registerAccount(Admin admin) throws HandledException;
   
   void removeAccount(String username) throws HandledException;
   
   List<Admin> getAccountList() throws HandledException;
   
   boolean login(String name, String password);
   
   void logout();
   
   boolean isLoggedIn();
   
   List<Loan> getLoans() throws HandledException;
   
   void addLoan(Loan loan) throws HandledException;
   
   Loan getLoan(String key) throws HandledException;
   
   void removeLoan(String key) throws HandledException;
   
   void saveLoan(Loan loan) throws HandledException;
   
   IPFeedbackData getFeedbackListWithIP(String ip) throws HandledException;
   
   List<Feedback> getFeedbackList(String loanKey) throws HandledException;
   
   void removeFeedback(String key) throws HandledException;
   
   void banIP(String ip) throws HandledException;
   
   boolean isBanned(String ip) throws HandledException;
   
   void removeBan(String ip) throws HandledException;
   
   void addFeedback(Feedback feedback) throws HandledException;
   
}
